<?php

namespace Yolo\Components\Scheduler;

interface SchedulerInterface
{
    /**
     * Get the scheduler config.
     * @return array
     */
    public function getConfig(): array;

    /**
     * Check if the scheduler is running.
     * @return bool
     */
    public function isRunning(): bool;

    /**
     * Set if the scheduler is running.
     * @param bool $running
     */
    public function setRunning(bool $running): void;

    /**
     * Check if the scheduler should run right away.
     * @return bool
     */
    public function isRunRightAway(): bool;

    /**
     * Set the last execution timestamp.
     */
    public function setLastExecutionTimestamp(int $timestamp): void;

    /**
     * Set the next execution timestamp.
     */
    public function setNextExecutionTimestamp(int $timestamp): void;

    /**
     * Get the last execution timestamp.
     * @return int
     */
    public function getLastExecutionTimestamp(): int;

    /**
     * Get the next execution timestamp.
     * @return int
     */
    public function getNextExecutionTimestamp(): int;

    /**
     * Execute the scheduler.
     * @return void
     */
    public function execute(): void;
}